package cn.chenxhcloud.myvv;

import org.voovan.network.aio.AioServerSocket;
import org.voovan.network.filter.StringFilter;
import org.voovan.network.messagesplitter.LineMessageSplitter;

/**
 * 
 * @author chenxh
 *
 */
public class Server {
	public static void main(String[] args) throws Exception {
		//SocketServer ip port timeout interval
		AioServerSocket serverSocket = new AioServerSocket("127.0.0.1", 2031, 20000);
		//处理器
		serverSocket.handler(new ServerHandler());
		//过滤器
		serverSocket.filterChain().add(new StringFilter());
		//分割器
		serverSocket.messageSplitter(new LineMessageSplitter());
		//start accept request
		serverSocket.start();
	}
}
